home *** CD-ROM | disk | FTP | other *** search
/ CD Ware Multimedia 1995 May / cd Ware (Juegos) Epimundo.iso / DOS / PRGMMING / PWORD_MC.ZIP / GRAPH.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1994-12-03  |  471 b   |  24 lines

  1. // Initialize graphics mode
  2. // Michael J. Campbell, 1994
  3.  
  4. #include <graphics.h>
  5. #include <stdlib.h>
  6. #include <stdio.h>
  7.  
  8. void set_graph(void)
  9.     {
  10.     int gd = DETECT, gm, crash;
  11.  
  12.     registerbgidriver(EGAVGA_driver);
  13.     registerbgifont(small_font);
  14.     initgraph(&gd, &gm, "");
  15.  
  16.     crash = graphresult();
  17.  
  18.     if (crash != grOk)  // Opps!
  19.         {
  20.         printf("\aThere is an error: %s\n", grapherrormsg(crash));
  21.         exit(1);             // Tell user you're not working
  22.         }
  23.     }
  24.